home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / CHINT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  494b  |  20 lines

  1. PROCEDURE chint(a,b: real; c: glcarray; VAR cint: glcarray; n: integer);
  2. (* Programs using routine CHINT must define the type glcarray as in
  3. routine CHEBFT. *)
  4. VAR
  5.    j: integer;
  6.    sum,fac,con: real;
  7. BEGIN
  8.    con := 0.25*(b-a);
  9.    sum := 0.0;
  10.    fac := 1.0;
  11.    FOR j := 2 TO n-1 DO BEGIN
  12.       cint[j] := con*(c[j-1]-c[j+1])/(j-1);
  13.       sum := sum+fac*cint[j];
  14.       fac := -fac
  15.    END;
  16.    cint[n] := con*c[n-1]/(n-1);
  17.    sum := sum+fac*cint[n];
  18.    cint[1] := 2.0*sum
  19. END;
  20.